/**
 * 
 */
package date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**  
* <p>Title: WeekOfYearUtil.java</p>  
* <p>Description: </p>  
* @author dragon  
* @date 2018年12月5日  
* @version 1.0  
*/
public class WeekOfYearUtil {
	
	public static void main(String[] args) {
		String today = "2019-12-31";  
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");  
		Date date = null;  
		try {  
		    date = format.parse(today);  
		} catch (ParseException e) {  
		    e.printStackTrace();  
		}  
		  
		Calendar calendar = Calendar.getInstance();  
		calendar.setFirstDayOfWeek(Calendar.MONDAY);  
		calendar.setTime(date);  
		  
		System.out.println(calendar.get(Calendar.WEEK_OF_YEAR));
	}

	
}
